#include <iostream>
using namespace std;

bool getnum7(int num);

int main()
{
    
    
    cout << "请输入一个数" << endl;
    cin >> num;
    
    for (int i = 0; i <= num; i++)
    {
        if (getnum7(num) || num % 7 == 0)
        {
            count++;
        }
    }

    cout << "共有" << count << "个数，与7有关" << endl;
    return 0;
}

bool getnum7(int num)
{
    int bit = num;

    while(num!= 0)
    {
        bit = num%10;
        if(bit == 7)
        {
            return true;
        }
        num = num/10;
    }

    return false;
}